package com.yanboo.modules.mnt.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import com.yanboo.common.base.BaseEntity;
import jakarta.persistence.*;
import java.io.Serializable;

@Entity
@Getter
@Setter
@Table(name="mnt_app")
public class App extends BaseEntity implements Serializable {

	@Schema(description = "名称")
    private String name;

	@Schema(description = "端口")
	private int port;

	@Schema(description = "上传路径")
	private String uploadPath;

	@Schema(description = "部署路径")
	private String deployPath;

	@Schema(description = "备份路径")
	private String backupPath;

	@Schema(description = "启动脚本")
	@Column(length = 4000)
	private String startScript;

	@Schema(description = "部署脚本")
	@Column(length = 4000)
	private String deployScript;

    public void copy(App source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
